<?php
import("data.logic.file.FileRepository");

class ImageRepository extends FileRepository {
	
	public function __construct($baseDir=null) {
		parent::__construct($baseDir);
		import("data.logic.file.FileInfo");
	}
	
	protected function initStorages() {
		$this->nsf->clearStorages();		
		$this->nsf->registryStorage("flickr", "net.storage.StorageServiceFlickr", "adiodom001","access99");		
	}
	
	function findAll() {
		return FileInfo::findAll();
	}
	
	function findAllByCategory($catId) {
		return FileInfo::findAllByCategory($catId);
	}
	
	function getContent($fileInfo) {
		$file = new File($this->baseDir."/".$fileInfo->getRepName());
		$service = $this->nsf->getPreferredStorage();
		return $service->getFileContent($file);
	}
	
	function clear() {
	}
}
?>